#! /usr/bin/env python
# coding=utf8

try:
    import pygtk
except ImportError:
    print "can not find pygtk"
    raise SystemExit

pygtk.require('2.0')
import gtk
import gtk.glade

class mainWindow:
    def __init__(self):
        resource = gtk.glade.XML('testui.glade')
        self.window = resource.get_widget('window')
        self.window.connect('destroy', self.onQuit)
        signal = { 'OnQuit' : self.onQuit }
        resource.signal_autoconnect(signal)
        self.window.show()
        gtk.main()

    def onQuit(self, widget):
        gtk.main_quit()

if __name__ == '__main__':
    window = mainWindow()
